﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.Web.UI.Controls;
using ZX.CRM.Bussiness;
using System.Data;
namespace ZX.WebApp.Crm.Report.Marketing
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        BCrmReport BReport = new BCrmReport();
        protected void Page_Load(object sender, EventArgs e)
        {
            DoReport("5月上海");
        }
        private void DoReport(string courseName)
        {
            try
            {
                DataSet myDataSet = new DataSet();
                myDataSet = BReport.ReturnDsLivePay(courseName);
                if (myDataSet != null)
                {
                    myDataSet.DataSetName = "DsBackMoney";
                    myDataSet.Tables[0].TableName = "DsLivePay";
                    DataTable datetable = new DataTable("DsSum");
                    myDataSet.Tables.Add(datetable);
                    datetable.Columns.Add("DeptName", typeof(string));
                    datetable.Columns.Add("Tsum", typeof(decimal));
                    datetable.Columns.Add("Rsum", typeof(decimal));
                    datetable.Columns.Add("BackPayRate", typeof(string));
                    datetable = BReport.ReturnDsLivePaySum(courseName).Tables[0];
                    myDataSet.Tables[1].TableName = "DsSum";
                    ZX.CRM.Report.CrmReport.RptLivePay crm = new ZX.CRM.Report.CrmReport.RptLivePay();
                    crm.DataSource = myDataSet;
                    RV.Report = crm;
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void btnDone_Click(object sender, EventArgs e)
        {
            DoReport(txtProductLayoutID.Value);
        }
    }
}